package com.wiley.sikuli;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;
import org.sikuli.script.Screen;

public class OnlinePainting {

	public static void main(String[] args) throws FindFailed, InterruptedException {
		WebDriver driver = new FirefoxDriver();
		driver.manage().window().maximize();
		driver.get("https://www.baidu.com");
		Screen screen = new Screen();
		/**
		 * 1、图片在根目录下
		 */
		screen.click("camera.png");
		
		/**
		 * 2、自定义图片位置
		 */
		Pattern upload = new Pattern("E:/workspace/sikuliDemo/pic/upload.png");
		screen.click(upload);
		
		screen.type("filename.png", "E:\\test\\upload.png");
		
		screen.click("openButton.png");
		
		Thread.sleep(3000);
		driver.quit();
	}
}
